<template>
  <div class="add-ti">
    <ckeditor id="ck" v-model="quesData.content" :height="'90px'" :placeholder="'请输入题干'"></ckeditor>
    <addUploads :quesFileList="quesData.quesFileList"></addUploads>
    <div v-if="quesType == 3">
      <a-radio-group v-model="quesData.answer" @change.stop="onChange" style="width: calc(100% - 8px);margin-left: 8px;">
        <a-radio class="options-box" :value="item.value" v-for="(item,index) in quesData.options" :key="index">
            {{Alphabet[index]}}、{{item.content}}
        </a-radio>
      </a-radio-group>
      <div style="line-height: 37px;margin-bottom: 10px;">
        <span>参考答案：
          <span v-if="quesData.answer=='0'">错误</span>
          <span v-if="quesData.answer=='1'">正确</span>

        </span>
      </div>
    </div>
    <div>
      <span style="line-height: 37px;">答案解析：</span>
      <div style="display: inline-block;width: calc(100% - 100px);vertical-align: top;">
        <ckeditor id="ck" v-model="quesData.analysis" :height="'90px'" :placeholder="'请输入解析'"></ckeditor>
      </div>
    </div>
  </div>
</template>

<script>
import addUploads from '@/components/addTi/addUpload/index.vue';
export default {
  data() {
    return {
      content: '',
      Alphabet: [
        'A',
        'B',
        'C',
        'D',
        'E',
        'F',
        'G',
        'H',
        'I',
        'J',
        'K',
        'L',
        'M',
        'N',
        'O',
        'P',
        'Q',
        'R',
        'S',
        'T',
        'U',
        'V',
        'W',
        'X',
        'Y',
        'Z'
      ],
      radioStyle: {display: 'block'},
    };
  },
  components: {
    addUploads
  },
  props: {
    quesData: {
      type: Object,
      default: () =>{}
    },
    quesType: {
      type: Number,
      default: 0
    }
  },
  mounted() {},
  methods: {
    getContent() {
      setTimeout(() => {
        console.log(this.quesData);
      }, 200);
    },
    onChange(e) {
      console.log('radio checked', e.target.value);
    },
  }
};
</script>

<style>
</style>